package com.aw.guiguzi.enums

import java.util.Arrays

enum class NumEnums(var code: Int, var desc: String, @JvmField var block: List<Int>) {
    ALL(0, "所有数", ArrayList(Arrays.asList(*arrayOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)))), BIG(
        1, "大数", ArrayList(
            Arrays.asList(*arrayOf(5, 6, 7, 8, 9))
        )
    ),
    SMALL(2, "小数", ArrayList(Arrays.asList(*arrayOf(0, 1, 2, 3, 4)))), SINGULAR(
        3, "单数", ArrayList(
            Arrays.asList(*arrayOf(1, 3, 5, 7, 9))
        )
    ),
    EVEN(4, "双数", ArrayList(Arrays.asList(*arrayOf(0, 2, 4, 6, 8)))), RED(
        5, "红数", ArrayList(
            Arrays.asList(*arrayOf(0, 3, 4, 7, 8))
        )
    ),
    YELLOW(6, "黄数", ArrayList(Arrays.asList(*arrayOf(1, 2, 5, 6, 9)))), BLOCK_02358(
        7, "组合02358", ArrayList(
            Arrays.asList(*arrayOf(0, 2, 3, 5, 8))
        )
    ),
    BLOCK_12479(8, "组合12479", ArrayList(Arrays.asList(*arrayOf(1, 2, 4, 7, 9)))), BLOCK_01689(
        9, "组合01689", ArrayList(
            Arrays.asList(*arrayOf(0, 1, 6, 8, 9))
        )
    ),
    BLOCK_369(10, "组合369", ArrayList(Arrays.asList(*arrayOf(3, 6, 9)))), MIDDLE(
        11, "中间数", ArrayList(
            Arrays.asList(*arrayOf(2, 3, 4, 5, 6, 7))
        )
    ),
    EDGE(12, "边缘数", ArrayList(Arrays.asList(*arrayOf(0, 1, 8, 9))));

    companion object {
        @JvmStatic
        fun getBlock(code: Int): List<Int> {
            return if (code == ALL.code) {
                ALL.block
            } else if (code == BIG.code) {
                BIG.block
            } else if (code == SMALL.code) {
                SMALL.block
            } else if (code == SINGULAR.code) {
                SINGULAR.block
            } else if (code == EVEN.code) {
                EVEN.block
            } else if (code == RED.code) {
                RED.block
            } else if (code == YELLOW.code) {
                YELLOW.block
            } else if (code == BLOCK_02358.code) {
                BLOCK_02358.block
            } else if (code == BLOCK_12479.code) {
                BLOCK_12479.block
            } else if (code == BLOCK_01689.code) {
                BLOCK_01689.block
            } else if (code == BLOCK_369.code) {
                BLOCK_369.block
            } else {
                ALL.block
            }
        }
    }
}